13
0
geforkt von Mirrors/Paper

Do not copy profile data if profiles are the same (#10259)

Dieser Commit ist enthalten in:
Shane Freeder 2024-03-20 21:47:50 +00:00
Ursprung b17ca0b19e
Commit 5efed01031

Datei anzeigen

@ -236,7 +236,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // if old has it, assume its newer, so overwrite, else use cached if it was set and ours wasn't
+ copyProfileProperties(this.profile, profile);
+ this.profile = profile;
+ } else {
+ } else if (profile != this.profile) {
+ copyProfileProperties(profile, this.profile);
+ }
+ }
@ -267,6 +267,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ private static void copyProfileProperties(GameProfile source, GameProfile target, boolean clearTarget) {
+ if (source == target) {
+ throw new IllegalArgumentException("Source and target profiles are the same (" + source + ")");
+ }
+ PropertyMap sourceProperties = source.getProperties();
+ PropertyMap targetProperties = target.getProperties();
+ if (clearTarget) targetProperties.clear();