mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-03 23:07:40 +01:00
Configurable UserCache cap
By: drXor <mcyoungsota@gmail.com>
This commit is contained in:
parent
05f3042755
commit
542b7a7eb1
@ -36,3 +36,12 @@
|
|||||||
|
|
||||||
Objects.requireNonNull(list);
|
Objects.requireNonNull(list);
|
||||||
optional.ifPresent(list::add);
|
optional.ifPresent(list::add);
|
||||||
|
@@ -261,7 +261,7 @@
|
||||||
|
JsonArray jsonarray = new JsonArray();
|
||||||
|
DateFormat dateformat = GameProfileCache.createDateFormat();
|
||||||
|
|
||||||
|
- this.getTopMRUProfiles(1000).forEach((usercache_usercacheentry) -> {
|
||||||
|
+ this.getTopMRUProfiles(org.spigotmc.SpigotConfig.userCacheCap).forEach((usercache_usercacheentry) -> { // Spigot
|
||||||
|
jsonarray.add(GameProfileCache.writeGameProfile(usercache_usercacheentry, dateformat));
|
||||||
|
});
|
||||||
|
String s = this.gson.toJson(jsonarray);
|
||||||
|
@ -314,4 +314,10 @@ public class SpigotConfig
|
|||||||
SpigotConfig.replaceCommands = new HashSet<String>( (List<String>) SpigotConfig.getList( "commands.replace-commands",
|
SpigotConfig.replaceCommands = new HashSet<String>( (List<String>) SpigotConfig.getList( "commands.replace-commands",
|
||||||
Arrays.asList( "setblock", "summon", "testforblock", "tellraw" ) ) );
|
Arrays.asList( "setblock", "summon", "testforblock", "tellraw" ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int userCacheCap;
|
||||||
|
private static void userCacheCap()
|
||||||
|
{
|
||||||
|
SpigotConfig.userCacheCap = SpigotConfig.getInt( "settings.user-cache-size", 1000 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user