geforkt von Mirrors/Paper
Ursprung
e78847f843
Commit
b90a8b6df4
@ -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
|
||||
<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 +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<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;
|
||||
+
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren