PaperSpigot-Parent/CraftBukkit-Patches/0116-Configurable-UserCache-cap.patch

38 lines
1.3 KiB
Diff
Raw Normal View History

2015-05-25 14:05:40 +02:00
From d7e6fed853926571a63f8c90315f252ea09ce412 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
2015-05-25 14:05:40 +02:00
index 021853e..31b4e81 100644
--- a/src/main/java/net/minecraft/server/UserCache.java
+++ b/src/main/java/net/minecraft/server/UserCache.java
2015-05-09 22:23:26 +02:00
@@ -208,7 +208,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
2014-11-28 02:17:45 +01:00
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 );
+ }
}
--
2015-05-09 22:23:26 +02:00
2.1.4