2014-07-21 22:46:54 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
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
|
|
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
2015-02-28 12:36:22 +01:00
|
|
|
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
|
2016-02-29 22:33:06 +01:00
|
|
|
this.m.e();
|
2014-07-21 22:46:54 +02:00
|
|
|
}
|
2016-02-29 22:33:06 +01:00
|
|
|
|
|
|
|
+ // Spigot start
|
|
|
|
+ if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
|
|
|
|
+ LOGGER.info("Saving usercache.json");
|
|
|
|
+ this.X.c();
|
|
|
|
+ }
|
|
|
|
+ // Spigot end
|
2014-07-21 22:46:54 +02:00
|
|
|
}
|
|
|
|
|
2016-02-29 22:33:06 +01:00
|
|
|
public String getServerIp() {
|
2014-07-21 22:46:54 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java
|
|
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/UserCache.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/UserCache.java
|
2015-07-23 22:43:27 +02:00
|
|
|
@@ -0,0 +0,0 @@ public class UserCache {
|
2016-02-29 22:33:06 +01:00
|
|
|
this.d.put(gameprofile.getName().toLowerCase(Locale.ROOT), usercache_usercacheentry);
|
|
|
|
this.e.put(uuid, usercache_usercacheentry);
|
|
|
|
this.f.addFirst(gameprofile);
|
2015-07-23 22:43:27 +02:00
|
|
|
- this.c();
|
|
|
|
+ if( !org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly ) this.c(); // Spigot - skip saving if disabled
|
|
|
|
}
|
|
|
|
|
|
|
|
public GameProfile getProfile(String s) {
|
2014-07-21 22:46:54 +02:00
|
|
|
@@ -0,0 +0,0 @@ public class UserCache {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- 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
|
|
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
|
|
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
|
|
|
@@ -0,0 +0,0 @@ public class SpigotConfig
|
|
|
|
{
|
|
|
|
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-29 11:35:21 +02:00
|
|
|
--
|