geforkt von Mirrors/Paper
Ursprung
48d8add662
Commit
85c6f826e4
@ -1,4 +1,4 @@
|
||||
From cb77703817c58fc10b14faf4fbfaeee5a9f98e7b Mon Sep 17 00:00:00 2001
|
||||
From bf4c10675dba6aa49c9d4db585c9d70b1da00637 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sat, 17 Jun 2017 16:30:44 -0400
|
||||
Subject: [PATCH] Profile Lookup Events
|
||||
@ -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
|
||||
@@ -62,6 +62,13 @@
|
||||
@ -26,10 +26,10 @@ index de5bc3f3..293442c3 100644
|
||||
<artifactId>fastutil-lite</artifactId>
|
||||
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 +1,43 @@
|
||||
@@ -0,0 +1,53 @@
|
||||
+package com.destroystokyo.paper.event.profile;
|
||||
+
|
||||
+import com.mojang.authlib.GameProfile;
|
||||
@ -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,10 +85,10 @@ 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 +1,155 @@
|
||||
@@ -0,0 +1,170 @@
|
||||
+package com.destroystokyo.paper.event.profile;
|
||||
+
|
||||
+import com.google.common.collect.Multimap;
|
||||
@ -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<String, Property> 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<String, Property> 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<String, Property> 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<String> 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;
|
||||
+
|
||||
@ -235,5 +260,5 @@ index 00000000..750b9334
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.13.3.windows.1
|
||||
2.14.1
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren