2020-07-17 18:05:50 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2020-08-06 19:18:29 +02:00
|
|
|
From: tr7zw <tr7zw@live.de>
|
2020-08-03 18:48:42 +02:00
|
|
|
Date: Sat, 1 Aug 2020 15:52:50 -0500
|
2020-02-26 22:22:46 +01:00
|
|
|
Subject: [PATCH] Add GameProfileLookupEvent
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/pom.xml b/pom.xml
|
2021-01-05 18:21:38 +01:00
|
|
|
index 89542d52c14cc009d8bf50f446ab2bebb8516c94..3e6971d0bbc383e4639e402c076af5292ee9236a 100644
|
2020-02-26 22:22:46 +01:00
|
|
|
--- a/pom.xml
|
|
|
|
+++ b/pom.xml
|
2020-09-09 16:18:52 +02:00
|
|
|
@@ -52,6 +52,10 @@
|
2020-02-26 22:22:46 +01:00
|
|
|
<id>sonatype</id>
|
|
|
|
<url>https://oss.sonatype.org/content/groups/public/</url>
|
|
|
|
</repository>
|
|
|
|
+ <repository>
|
|
|
|
+ <id>mojang</id>
|
|
|
|
+ <url>https://libraries.minecraft.net/</url>
|
|
|
|
+ </repository>
|
|
|
|
</repositories>
|
|
|
|
|
|
|
|
<pluginRepositories>
|
2020-09-09 16:18:52 +02:00
|
|
|
@@ -62,6 +66,13 @@
|
2020-02-26 22:22:46 +01:00
|
|
|
</pluginRepositories>
|
|
|
|
|
|
|
|
<dependencies>
|
2020-08-03 18:48:42 +02:00
|
|
|
+ <!-- Authlib for Gameprofiles -->
|
2020-02-26 22:22:46 +01:00
|
|
|
+ <dependency>
|
|
|
|
+ <groupId>com.mojang</groupId>
|
|
|
|
+ <artifactId>authlib</artifactId>
|
|
|
|
+ <version>1.5.25</version>
|
|
|
|
+ <scope>provided</scope>
|
|
|
|
+ </dependency>
|
|
|
|
<dependency>
|
|
|
|
<groupId>it.unimi.dsi</groupId>
|
|
|
|
<artifactId>fastutil</artifactId>
|
2020-08-03 18:48:42 +02:00
|
|
|
diff --git a/src/main/java/dev/tr7zw/yatopia/events/GameProfileLookupEvent.java b/src/main/java/dev/tr7zw/yatopia/events/GameProfileLookupEvent.java
|
2020-02-26 22:22:46 +01:00
|
|
|
new file mode 100644
|
2021-01-05 18:21:38 +01:00
|
|
|
index 0000000000000000000000000000000000000000..313fe42442a93db76f91eaab50a345340f314fa8
|
2020-02-26 22:22:46 +01:00
|
|
|
--- /dev/null
|
2020-08-03 18:48:42 +02:00
|
|
|
+++ b/src/main/java/dev/tr7zw/yatopia/events/GameProfileLookupEvent.java
|
2021-01-05 18:21:38 +01:00
|
|
|
@@ -0,0 +1,51 @@
|
2020-08-03 18:48:42 +02:00
|
|
|
+package dev.tr7zw.yatopia.events;
|
2020-02-26 22:22:46 +01:00
|
|
|
+
|
2021-01-05 18:21:38 +01:00
|
|
|
+import com.mojang.authlib.GameProfile;
|
2020-02-27 22:17:46 +01:00
|
|
|
+import java.util.UUID;
|
2020-02-26 22:22:46 +01:00
|
|
|
+import org.bukkit.event.Event;
|
|
|
|
+import org.bukkit.event.HandlerList;
|
2021-01-05 18:21:38 +01:00
|
|
|
+import org.jetbrains.annotations.NotNull;
|
|
|
|
+import org.jetbrains.annotations.Nullable;
|
2020-02-26 22:22:46 +01:00
|
|
|
+
|
|
|
|
+public class GameProfileLookupEvent extends Event {
|
|
|
|
+ private static final HandlerList handlers = new HandlerList();
|
|
|
|
+ private GameProfile gameProfile = null;
|
2020-02-27 22:17:46 +01:00
|
|
|
+ private final UUID uuid;
|
|
|
|
+ private final String name;
|
2020-02-26 22:22:46 +01:00
|
|
|
+
|
2021-01-05 18:21:38 +01:00
|
|
|
+ public GameProfileLookupEvent(boolean async, @NotNull UUID uuid, @NotNull String name) {
|
|
|
|
+ super(async);
|
|
|
|
+ this.uuid = uuid;
|
|
|
|
+ this.name = name;
|
|
|
|
+ }
|
2020-02-26 22:22:46 +01:00
|
|
|
+
|
2021-01-05 18:21:38 +01:00
|
|
|
+ @Nullable
|
|
|
|
+ public GameProfile getGameProfile() {
|
|
|
|
+ return gameProfile;
|
|
|
|
+ }
|
2020-02-26 22:22:46 +01:00
|
|
|
+
|
2021-01-05 18:21:38 +01:00
|
|
|
+ public void setGameProfile(@Nullable GameProfile gameProfile) {
|
|
|
|
+ this.gameProfile = gameProfile;
|
|
|
|
+ }
|
2020-02-26 22:22:46 +01:00
|
|
|
+
|
2021-01-05 18:21:38 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ public UUID getUuid() {
|
|
|
|
+ return uuid;
|
|
|
|
+ }
|
2020-02-27 22:17:46 +01:00
|
|
|
+
|
2021-01-05 18:21:38 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ public String getName() {
|
|
|
|
+ return name;
|
|
|
|
+ }
|
2020-02-27 22:17:46 +01:00
|
|
|
+
|
2021-01-05 18:21:38 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ @Override
|
|
|
|
+ public HandlerList getHandlers() {
|
2020-02-26 22:22:46 +01:00
|
|
|
+ return handlers;
|
|
|
|
+ }
|
|
|
|
+
|
2021-01-05 18:21:38 +01:00
|
|
|
+ @NotNull
|
2020-02-26 22:22:46 +01:00
|
|
|
+ public static HandlerList getHandlerList() {
|
|
|
|
+ return handlers;
|
|
|
|
+ }
|
|
|
|
+}
|