PaperMC/CraftBukkit-Patches/0120-Configurable-UserCache-cap.patch
Zach Brown 19972e09b8 Update SpigotMC's patches
5a0150f586ed3eb15fe6f1f596d1a5a7d806f0f9 Fix ITEM_BREAK
e6a3911057bd94d8bd7021cbb4923fb84fb106d1 Upstream merge
d1cdcf8d4c3639f956474f02ed662517cffbe23e Remove old patch
068df64aeee368377e1673667bffc7a6dcf90554 Rebuild all patches
2014-11-30 16:16:48 -06:00

37 lines
1.3 KiB
Diff

From 7ca132b491e99801dd2338c9879afdae06b3af3f 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/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java
index 6781a64..3eeaf09 100644
--- a/src/main/java/net/minecraft/server/UserCache.java
+++ b/src/main/java/net/minecraft/server/UserCache.java
@@ -186,7 +186,7 @@ public class UserCache {
}
public void c() {
- String s = this.b.toJson(this.a(1000));
+ String s = this.b.toJson(this.a(org.spigotmc.SpigotConfig.userCacheCap));
BufferedWriter bufferedwriter = null;
try {
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 4932990..d416087 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -315,4 +315,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.1.0