[CI-SKIP] merge profile fill fix into base patch

This commit is contained in:
Zach Brown 2018-11-08 18:50:17 -05:00
parent 83e2208266
commit 16a6e7ee8b
No known key found for this signature in database
GPG Key ID: CC9DA35FC5450B76
2 changed files with 7 additions and 29 deletions

View File

@ -1,4 +1,4 @@
From 94844222be50f102f30ea65c4705d15e004b5530 Mon Sep 17 00:00:00 2001
From e7c6b3cc9faa0245c366ec6c840ff76155c6a3fa Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 2 Jan 2018 00:31:26 -0500
Subject: [PATCH] Fill Profile Property Events
@ -11,7 +11,7 @@ If Mojang API does need to be hit, event fire so you can get the results.
This is useful for implementing a ProfileCache for Player Skulls
diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java
index 4b2a67423f..f83aa5ef0f 100644
index 4b2a67423f..61cfdf73c8 100644
--- a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java
@@ -1,5 +1,7 @@
@ -22,12 +22,14 @@ index 4b2a67423f..f83aa5ef0f 100644
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
@@ -19,7 +21,13 @@ public class PaperMinecraftSessionService extends YggdrasilMinecraftSessionServi
@@ -19,7 +21,15 @@ public class PaperMinecraftSessionService extends YggdrasilMinecraftSessionServi
@Override
public GameProfile fillProfileProperties(GameProfile profile, boolean requireSecure) {
- return super.fillProfileProperties(profile, requireSecure);
+ new PreFillProfileEvent(CraftPlayerProfile.asBukkitMirror(profile)).callEvent();
+ CraftPlayerProfile playerProfile = (CraftPlayerProfile) CraftPlayerProfile.asBukkitMirror(profile);
+ new PreFillProfileEvent(playerProfile).callEvent();
+ profile = playerProfile.getGameProfile();
+ if (profile.isComplete() && profile.getProperties().containsKey("textures")) {
+ return profile;
+ }
@ -38,5 +40,5 @@ index 4b2a67423f..f83aa5ef0f 100644
@Override
--
2.19.0
2.19.1

View File

@ -1,24 +0,0 @@
From 510c7b25cfd7517fd29e1c76d1f124f06f58f8b2 Mon Sep 17 00:00:00 2001
From: BlackHole <black-hole@live.com>
Date: Thu, 8 Nov 2018 20:04:11 +0100
Subject: [PATCH] Fix PreFillProfileEvent
diff --git a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java
index f83aa5ef0..61cfdf73c 100644
--- a/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java
+++ b/src/main/java/com/destroystokyo/paper/profile/PaperMinecraftSessionService.java
@@ -21,7 +21,9 @@ public class PaperMinecraftSessionService extends YggdrasilMinecraftSessionServi
@Override
public GameProfile fillProfileProperties(GameProfile profile, boolean requireSecure) {
- new PreFillProfileEvent(CraftPlayerProfile.asBukkitMirror(profile)).callEvent();
+ CraftPlayerProfile playerProfile = (CraftPlayerProfile) CraftPlayerProfile.asBukkitMirror(profile);
+ new PreFillProfileEvent(playerProfile).callEvent();
+ profile = playerProfile.getGameProfile();
if (profile.isComplete() && profile.getProperties().containsKey("textures")) {
return profile;
}
--
2.19.1.windows.1