Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-15 19:10:09 +01:00
Add PlayerProfile.complete() API to trigger skin lookup
Dieser Commit ist enthalten in:
Ursprung
242e82f25b
Commit
e3e257562f
@ -1,4 +1,4 @@
|
|||||||
From a81aa18c534bcbca348329135c312a5725210352 Mon Sep 17 00:00:00 2001
|
From 0952cf855ca2b8bf45741e73250656ad452532c8 Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Mon, 15 Jan 2018 21:46:46 -0500
|
Date: Mon, 15 Jan 2018 21:46:46 -0500
|
||||||
Subject: [PATCH] Basic PlayerProfile API
|
Subject: [PATCH] Basic PlayerProfile API
|
||||||
@ -7,10 +7,10 @@ Provides basic elements of a PlayerProfile to be used by future API/events
|
|||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java
|
diff --git a/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 00000000..a7b69cab
|
index 00000000..0f44f98f
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java
|
+++ b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java
|
||||||
@@ -0,0 +1,90 @@
|
@@ -0,0 +1,97 @@
|
||||||
+package com.destroystokyo.paper.profile;
|
+package com.destroystokyo.paper.profile;
|
||||||
+
|
+
|
||||||
+import com.mojang.authlib.GameProfile;
|
+import com.mojang.authlib.GameProfile;
|
||||||
@ -96,6 +96,13 @@ index 00000000..a7b69cab
|
|||||||
+ boolean isComplete();
|
+ boolean isComplete();
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
|
+ * If this profile is not complete, then make the API call to complete it.
|
||||||
|
+ * This is a blocking operation and should be done asynchronously.
|
||||||
|
+ * @return if the profile is now complete
|
||||||
|
+ */
|
||||||
|
+ boolean complete();
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
+ * @deprecated Will be removed in 1.13
|
+ * @deprecated Will be removed in 1.13
|
||||||
+ */
|
+ */
|
||||||
+ @Deprecated
|
+ @Deprecated
|
||||||
@ -277,5 +284,5 @@ index 87ab9d2b..f2ee6516 100644
|
|||||||
// Paper end
|
// Paper end
|
||||||
}
|
}
|
||||||
--
|
--
|
||||||
2.15.1
|
2.16.2
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
From 169a4bcde7aa5596794b15d147b9c331d8b01fb0 Mon Sep 17 00:00:00 2001
|
From d59f6eb0f4ce7dbd4e2ad3c366c5950e1bb6d9ca Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Mon, 15 Jan 2018 22:11:48 -0500
|
Date: Mon, 15 Jan 2018 22:11:48 -0500
|
||||||
Subject: [PATCH] Basic PlayerProfile API
|
Subject: [PATCH] Basic PlayerProfile API
|
||||||
@ -6,15 +6,16 @@ Subject: [PATCH] Basic PlayerProfile API
|
|||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
|
diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 000000000..e673726c5
|
index 000000000..2cfd65bc1
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
|
+++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java
|
||||||
@@ -0,0 +1,191 @@
|
@@ -0,0 +1,197 @@
|
||||||
+package com.destroystokyo.paper.profile;
|
+package com.destroystokyo.paper.profile;
|
||||||
+
|
+
|
||||||
+import com.mojang.authlib.GameProfile;
|
+import com.mojang.authlib.GameProfile;
|
||||||
+import com.mojang.authlib.properties.Property;
|
+import com.mojang.authlib.properties.Property;
|
||||||
+import com.mojang.authlib.properties.PropertyMap;
|
+import com.mojang.authlib.properties.PropertyMap;
|
||||||
|
+import net.minecraft.server.MinecraftServer;
|
||||||
+
|
+
|
||||||
+import javax.annotation.Nonnull;
|
+import javax.annotation.Nonnull;
|
||||||
+import javax.annotation.Nullable;
|
+import javax.annotation.Nullable;
|
||||||
@ -26,7 +27,7 @@ index 000000000..e673726c5
|
|||||||
+
|
+
|
||||||
+public class CraftPlayerProfile implements PlayerProfile {
|
+public class CraftPlayerProfile implements PlayerProfile {
|
||||||
+
|
+
|
||||||
+ private final GameProfile profile;
|
+ private GameProfile profile;
|
||||||
+ private final PropertySet properties;
|
+ private final PropertySet properties;
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
@ -119,6 +120,11 @@ index 000000000..e673726c5
|
|||||||
+ return profile.isComplete();
|
+ return profile.isComplete();
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
+ public boolean complete() {
|
||||||
|
+ profile = MinecraftServer.getServer().getSessionService().fillProfileProperties(profile, true);
|
||||||
|
+ return profile.isComplete();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
+ private static ProfileProperty toBukkit(Property property) {
|
+ private static ProfileProperty toBukkit(Property property) {
|
||||||
+ return new ProfileProperty(property.getName(), property.getValue(), property.getSignature());
|
+ return new ProfileProperty(property.getName(), property.getValue(), property.getSignature());
|
||||||
+ }
|
+ }
|
||||||
@ -226,6 +232,18 @@ index 02940d697..4539b5601 100644
|
|||||||
/**
|
/**
|
||||||
* Calculates distance between 2 entities
|
* Calculates distance between 2 entities
|
||||||
* @param e1
|
* @param e1
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
index e8bddc171..3b01ebd96 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
|
@@ -1538,6 +1538,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs
|
||||||
|
this.H = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public MinecraftSessionService getSessionService() { return az(); } // Paper - OBFHELPER
|
||||||
|
public MinecraftSessionService az() {
|
||||||
|
return this.W;
|
||||||
|
}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index 77c16fe2c..aca5ea7c0 100644
|
index 77c16fe2c..aca5ea7c0 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren