2014-12-21 01:09:49 +00:00
|
|
|
From db170b4f7c502cd7b3d592927ba2613b8ca4e0e3 Mon Sep 17 00:00:00 2001
|
2014-07-21 20:46:54 +00:00
|
|
|
From: drXor <mcyoungsota@gmail.com>
|
|
|
|
Date: Fri, 23 May 2014 18:05:10 -0400
|
|
|
|
Subject: [PATCH] Configurable save-on-stop-only for UserCache
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2014-12-06 03:33:40 +00:00
|
|
|
index 8521259..f13be48 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2014-12-06 03:33:40 +00:00
|
|
|
@@ -455,7 +455,13 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs
|
2014-11-28 01:17:45 +00:00
|
|
|
if (this.m.d()) {
|
|
|
|
this.m.e();
|
2014-07-21 20:46:54 +00:00
|
|
|
}
|
2014-11-28 01:17:45 +00:00
|
|
|
-
|
2014-07-21 20:46:54 +00:00
|
|
|
+ // Spigot start
|
|
|
|
+ if( org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly )
|
|
|
|
+ {
|
2014-11-28 01:17:45 +00:00
|
|
|
+ LOGGER.info("Saving usercache.json");
|
|
|
|
+ this.Z.c();
|
2014-07-21 20:46:54 +00:00
|
|
|
+ }
|
|
|
|
+ //Spigot end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java
|
2014-11-28 01:17:45 +00:00
|
|
|
index 3eeaf09..03abfbd 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/UserCache.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/UserCache.java
|
2014-11-28 01:17:45 +00:00
|
|
|
@@ -120,7 +120,7 @@ public class UserCache {
|
2014-07-21 20:46:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- this.c();
|
|
|
|
+ if( !org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly ) this.c(); // Spigot - skip saving if disabled
|
|
|
|
return usercacheentry == null ? null : usercacheentry.a();
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
2014-11-28 01:17:45 +00:00
|
|
|
index d416087..78dcb39 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
2014-07-30 08:35:19 +00:00
|
|
|
@@ -321,4 +321,10 @@ public class SpigotConfig
|
2014-07-21 20:46:54 +00:00
|
|
|
{
|
|
|
|
userCacheCap = getInt( "settings.user-cache-size", 1000 );
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public static boolean saveUserCacheOnStopOnly;
|
|
|
|
+ private static void saveUserCacheOnStopOnly()
|
|
|
|
+ {
|
|
|
|
+ saveUserCacheOnStopOnly = getBoolean( "settings.save-user-cache-on-stop-only", false );
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2014-11-28 01:17:45 +00:00
|
|
|
2.1.0
|
2014-07-21 20:46:54 +00:00
|
|
|
|