aboutsummaryrefslogtreecommitdiffhomepage
path: root/CraftBukkit-Patches/0138-Configurable-UserCache-cap.patch
diff options
context:
space:
mode:
Diffstat (limited to 'CraftBukkit-Patches/0138-Configurable-UserCache-cap.patch')
-rw-r--r--CraftBukkit-Patches/0138-Configurable-UserCache-cap.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/CraftBukkit-Patches/0138-Configurable-UserCache-cap.patch b/CraftBukkit-Patches/0138-Configurable-UserCache-cap.patch
new file mode 100644
index 0000000000..19df49a5ed
--- /dev/null
+++ b/CraftBukkit-Patches/0138-Configurable-UserCache-cap.patch
@@ -0,0 +1,37 @@
+From 7e0007b7cee79859c5ec5b92355e4051abe42e42 Mon Sep 17 00:00:00 2001
+From: drXor <[email protected]>
+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 bbbcc86..4aea9df 100644
+--- a/src/main/java/net/minecraft/server/UserCache.java
++++ b/src/main/java/net/minecraft/server/UserCache.java
+@@ -206,7 +206,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 e4ee00e..2bc7333 100644
+--- a/src/main/java/org/spigotmc/SpigotConfig.java
++++ b/src/main/java/org/spigotmc/SpigotConfig.java
+@@ -309,4 +309,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 );
++ }
+ }
+--
+1.9.1
+