2015-05-09 22:23:26 +02:00
|
|
|
From c06e01709cb85b4d1317028a5e362c3ee24bf43f Mon Sep 17 00:00:00 2001
|
2014-07-21 22:46:54 +02: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
|
2015-05-09 22:23:26 +02:00
|
|
|
index 0dbe68c..17dbe9f 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2015-05-09 22:23:26 +02:00
|
|
|
@@ -489,7 +489,13 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
|
2015-02-28 12:36:22 +01:00
|
|
|
if (this.n.d()) {
|
|
|
|
this.n.e();
|
2014-07-21 22:46:54 +02:00
|
|
|
}
|
2014-11-28 02:17:45 +01:00
|
|
|
-
|
2014-07-21 22:46:54 +02:00
|
|
|
+ // Spigot start
|
|
|
|
+ if( org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly )
|
|
|
|
+ {
|
2014-11-28 02:17:45 +01:00
|
|
|
+ LOGGER.info("Saving usercache.json");
|
|
|
|
+ this.Z.c();
|
2014-07-21 22:46:54 +02:00
|
|
|
+ }
|
|
|
|
+ //Spigot end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git 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
|
|
|
index 41e297f..6f464be 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- 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
|
|
|
@@ -149,7 +149,7 @@ public class UserCache {
|
2014-07-21 22:46:54 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- this.c();
|
|
|
|
+ if( !org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly ) this.c(); // Spigot - skip saving if disabled
|
2015-02-28 12:36:22 +01:00
|
|
|
return usercache_usercacheentry == null ? null : usercache_usercacheentry.a();
|
2014-07-21 22:46:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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 d416087..78dcb39 100644
|
2014-07-21 22:46:54 +02:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
2014-07-30 10:35:19 +02:00
|
|
|
@@ -321,4 +321,10 @@ public class SpigotConfig
|
2014-07-21 22:46:54 +02: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 );
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2015-05-09 22:23:26 +02:00
|
|
|
2.1.4
|
2014-07-21 22:46:54 +02:00
|
|
|
|