From b90a8b6df4baef000058abcfa025687af77119b7 Mon Sep 17 00:00:00 2001 From: Riley Park Date: Tue, 22 Aug 2017 19:08:41 -0700 Subject: [PATCH] Deprecate usages of authlib ref #828 --- .../Profile-Lookup-Events.patch | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/Spigot-API-Patches/Profile-Lookup-Events.patch b/Spigot-API-Patches/Profile-Lookup-Events.patch index 5fa32b6796..5a327c8009 100644 --- a/Spigot-API-Patches/Profile-Lookup-Events.patch +++ b/Spigot-API-Patches/Profile-Lookup-Events.patch @@ -7,7 +7,7 @@ Adds a Pre Lookup Event and a Post Lookup Event so that plugins may prefill in p profiles that had to be looked up. diff --git a/pom.xml b/pom.xml -index de5bc3f3..293442c3 100644 +index 31b6f51b..60e9f910 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ @@ -26,7 +26,7 @@ index de5bc3f3..293442c3 100644 fastutil-lite diff --git a/src/main/java/com/destroystokyo/paper/event/profile/LookupProfileEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/LookupProfileEvent.java new file mode 100644 -index 00000000..6074ecde +index 00000000..37e957f4 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/profile/LookupProfileEvent.java @@ -0,0 +0,0 @@ @@ -49,9 +49,16 @@ index 00000000..6074ecde +public class LookupProfileEvent extends Event { + + private static final HandlerList handlers = new HandlerList(); -+ ++ /** ++ * @deprecated will be removed with 1.13 ++ */ ++ @Deprecated + private final GameProfile profile; + ++ /** ++ * @deprecated will be removed with 1.13 ++ */ ++ @Deprecated + public LookupProfileEvent(@Nonnull GameProfile profile) { + super(!Bukkit.isPrimaryThread()); + this.profile = profile; @@ -59,12 +66,15 @@ index 00000000..6074ecde + + /** + * @return The profile that was recently looked up. This profile can be mutated ++ * @deprecated will be removed with 1.13 + */ ++ @Deprecated + @Nonnull + public GameProfile getProfile() { + return profile; + } + ++ @Override + public HandlerList getHandlers() { + return handlers; + } @@ -75,7 +85,7 @@ index 00000000..6074ecde +} diff --git a/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java new file mode 100644 -index 00000000..750b9334 +index 00000000..455ffaa1 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java @@ -0,0 +0,0 @@ @@ -110,10 +120,12 @@ index 00000000..750b9334 +public class PreLookupProfileEvent extends Event { + + private static final HandlerList handlers = new HandlerList(); -+ + private final String name; -+ + private UUID uuid; ++ /** ++ * @deprecated will be removed with 1.13 ++ */ ++ @Deprecated + private PropertyMap properties = new PropertyMap(); + + public PreLookupProfileEvent(@Nonnull String name) { @@ -130,11 +142,11 @@ index 00000000..750b9334 + } + + /** -+ * @return The UUID of the profile if it has already been provided by a plugin -+ * + * If this value is left null by the completion of the event call, then the server will + * trigger a call to the Mojang API to look up the UUID (Network Request), and subsequently, fire a + * {@link LookupProfileEvent} ++ * ++ * @return The UUID of the profile if it has already been provided by a plugin + */ + @Nullable + public UUID getUUID() { @@ -156,7 +168,9 @@ index 00000000..750b9334 + * Get the properties for this profile + * + * @return the property map to attach to the new {@link GameProfile} ++ * @deprecated will be removed with 1.13 + */ ++ @Deprecated + @Nonnull + public Multimap getProperties() { + return properties; @@ -165,7 +179,9 @@ index 00000000..750b9334 + /** + * Completely replaces all Properties with the new provided properties + * @param properties the properties to set on the new profile ++ * @deprecated will be removed with 1.13 + */ ++ @Deprecated + public void setProperties(Multimap properties) { + this.properties = new PropertyMap(); + this.properties.putAll(properties); @@ -174,11 +190,14 @@ index 00000000..750b9334 + /** + * Adds additional properties, without removing the original properties + * @param properties the properties to add to the existing properties ++ * @deprecated will be removed with 1.13 + */ ++ @Deprecated + public void addProperties(Multimap properties) { + this.properties.putAll(properties); + } + ++ @Override + public HandlerList getHandlers() { + return handlers; + } @@ -187,9 +206,11 @@ index 00000000..750b9334 + return handlers; + } + -+ /* ++ /** + * Wraps the Profile Repository so we can intercept all lookups ++ * @deprecated will be removed with 1.13 + */ ++ @Deprecated + public static GameProfileRepository wrapProfileRepository(final GameProfileRepository orig) { + return (names, agent, callback) -> { + Set unfoundNames = Sets.newHashSet(); @@ -215,6 +236,10 @@ index 00000000..750b9334 + }; + } + ++ /** ++ * @deprecated will be removed with 1.13 ++ */ ++ @Deprecated + private static class PreProfileLookupCallback implements ProfileLookupCallback { + private final ProfileLookupCallback callback; +