1.16.2 Release (#4123)
PaperMC believes that 1.16.2 is now ready for general release as we fixed the main issue plagueing the 1.16.x release, the MapLike data conversion issues. Until now, it was not safe for a server to convert a world to 1.16.2 without data conversion issues around villages and potentially other things. If you did, those MapLike errors meant something went wrong. This is now resolved. Big thanks to all those that helped, notably @BillyGalbreath and @Proximyst who did large parts of the update process with me. Please as always, backup your worlds and test before updating to 1.16.2! If you update to 1.16.2, there is no going back to an older build than this. --------------------------------- Co-authored-by: William Blake Galbreath <Blake.Galbreath@GMail.com> Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com> Co-authored-by: krolik-exe <69214078+krolik-exe@users.noreply.github.com> Co-authored-by: BillyGalbreath <BillyGalbreath@users.noreply.github.com> Co-authored-by: stonar96 <minecraft.stonar96@gmail.com> Co-authored-by: Shane Freeder <theboyetronic@gmail.com> Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Co-authored-by: Riley Park <rileysebastianpark@gmail.com> Co-authored-by: Aurora <21148213+aurorasmiles@users.noreply.github.com> Co-authored-by: Nassim Jahnke <nassim@njahnke.dev> Co-authored-by: commandblockguy <commandblockguy1@gmail.com> Co-authored-by: DigitalRegent <misterwener@gmail.com> Co-authored-by: ishland <ishlandmc@yeah.net>
This commit is contained in:
@@ -9,6 +9,19 @@ easier to do this than replace the entire thing.
|
||||
Additionally, move Saving of the User cache to be done async, incase
|
||||
the user never changed the default setting for Spigot's save on stop only.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
}
|
||||
|
||||
if (this.convertNames()) {
|
||||
- this.getUserCache().b();
|
||||
+ this.getUserCache().b(false); // Paper
|
||||
}
|
||||
|
||||
if (!NameReferencingFileConverter.e(this)) {
|
||||
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
|
||||
@@ -17,8 +30,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
} catch (java.lang.InterruptedException ignored) {} // Paper
|
||||
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
|
||||
LOGGER.info("Saving usercache.json");
|
||||
- this.getUserCache().c();
|
||||
+ this.getUserCache().c(false); // Paper
|
||||
- this.getUserCache().b();
|
||||
+ this.getUserCache().b(false); // Paper
|
||||
}
|
||||
// Spigot end
|
||||
|
||||
@@ -27,36 +40,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/server/UserCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/UserCache.java
|
||||
@@ -0,0 +0,0 @@ public class UserCache {
|
||||
|
||||
public static final SimpleDateFormat a = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
|
||||
private static boolean c;
|
||||
- private final Map<String, UserCache.UserCacheEntry> d = Maps.newHashMap();
|
||||
- private final Map<UUID, UserCache.UserCacheEntry> e = Maps.newHashMap();
|
||||
+ private final Map<String, UserCache.UserCacheEntry> d = new java.util.concurrent.ConcurrentHashMap<>(); // Paper
|
||||
+ private final Map<UUID, UserCache.UserCacheEntry> e = new java.util.concurrent.ConcurrentHashMap<>(); // Paper
|
||||
private final Deque<GameProfile> f = new java.util.concurrent.LinkedBlockingDeque<GameProfile>(); // CraftBukkit
|
||||
private final GameProfileRepository g;
|
||||
protected final Gson b;
|
||||
@@ -0,0 +0,0 @@ public class UserCache {
|
||||
this.a(gameprofile, (Date) null);
|
||||
return UserCache.b;
|
||||
}
|
||||
|
||||
- private void a(GameProfile gameprofile, Date date) {
|
||||
+ private synchronized void a(GameProfile gameprofile, Date date) { // Paper - synchronize
|
||||
UUID uuid = gameprofile.getId();
|
||||
- public void a(GameProfile gameprofile) {
|
||||
+ public synchronized void a(GameProfile gameprofile) { // Paper - synchronize
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
||||
if (date == null) {
|
||||
calendar.setTime(new Date());
|
||||
@@ -0,0 +0,0 @@ public class UserCache {
|
||||
|
||||
UserCache.UserCacheEntry usercache_usercacheentry = new UserCache.UserCacheEntry(gameprofile, date);
|
||||
|
||||
- if (this.e.containsKey(uuid)) {
|
||||
+ //if (this.e.containsKey(uuid)) { // Paper
|
||||
UserCache.UserCacheEntry usercache_usercacheentry1 = (UserCache.UserCacheEntry) this.e.get(uuid);
|
||||
+ if (usercache_usercacheentry1 != null) { // Paper
|
||||
this.a(usercache_usercacheentry);
|
||||
- if( !org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly ) this.b(); // Spigot - skip saving if disabled
|
||||
+ if( !org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly ) this.b(true); // Spigot - skip saving if disabled // Paper - async
|
||||
}
|
||||
|
||||
this.d.remove(usercache_usercacheentry1.a().getName().toLowerCase(Locale.ROOT));
|
||||
this.f.remove(gameprofile);
|
||||
private long d() {
|
||||
@@ -0,0 +0,0 @@ public class UserCache {
|
||||
}
|
||||
|
||||
@@ -64,27 +64,37 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- public GameProfile getProfile(String s) {
|
||||
+ public synchronized GameProfile getProfile(String s) { // Paper - synchronize
|
||||
String s1 = s.toLowerCase(Locale.ROOT);
|
||||
UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.d.get(s1);
|
||||
|
||||
UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.c.get(s1);
|
||||
boolean flag = false;
|
||||
@@ -0,0 +0,0 @@ public class UserCache {
|
||||
}
|
||||
|
||||
if (flag && !org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { // Spigot - skip saving if disabled
|
||||
- this.b();
|
||||
+ this.b(true); // Paper
|
||||
}
|
||||
|
||||
return gameprofile;
|
||||
@@ -0,0 +0,0 @@ public class UserCache {
|
||||
return arraylist;
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
public void c() {
|
||||
+ c(true);
|
||||
+ }
|
||||
+ public void c(boolean asyncSave) {
|
||||
+ // Paper end
|
||||
String s = this.b.toJson(this.a(org.spigotmc.SpigotConfig.userCacheCap));
|
||||
+ Runnable save = () -> {
|
||||
+
|
||||
BufferedWriter bufferedwriter = null;
|
||||
- public void b() {
|
||||
+ public void b(boolean asyncSave) { // Paper
|
||||
JsonArray jsonarray = new JsonArray();
|
||||
DateFormat dateformat = e();
|
||||
|
||||
@@ -0,0 +0,0 @@ public class UserCache {
|
||||
jsonarray.add(a(usercache_usercacheentry, dateformat));
|
||||
});
|
||||
String s = this.f.toJson(jsonarray);
|
||||
+ Runnable save = () -> { // Paper
|
||||
|
||||
try {
|
||||
BufferedWriter bufferedwriter = Files.newWriter(this.g, StandardCharsets.UTF_8);
|
||||
@@ -0,0 +0,0 @@ public class UserCache {
|
||||
} finally {
|
||||
IOUtils.closeQuietly(bufferedwriter);
|
||||
} catch (IOException ioexception) {
|
||||
;
|
||||
}
|
||||
+ // Paper start
|
||||
+ };
|
||||
|
||||
Reference in New Issue
Block a user