mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Do not copy profile data if profiles are the same (#10259)
This commit is contained in:
parent
b17ca0b19e
commit
5efed01031
1 changed files with 4 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue