Yatopia/patches/api/0003-Add-GameProfileLookupEvent.patch
2020-07-17 18:05:50 +02:00

87 lines
2.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Wed, 26 Feb 2020 22:21:14 +0100
Subject: [PATCH] Add GameProfileLookupEvent
diff --git a/pom.xml b/pom.xml
index 853f1fe45804cb69f3af9cd58ccc65ea242fe4f9..d6065069db2d44e9e779e3d9f6a69fa37aeaeebd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -39,6 +39,10 @@
<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>
@@ -49,6 +53,13 @@
</pluginRepositories>
<dependencies>
+ <!-- Authlib for Gameprofiles -->
+ <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>
diff --git a/src/main/java/de/tr7zw/yapfa/events/GameProfileLookupEvent.java b/src/main/java/de/tr7zw/yapfa/events/GameProfileLookupEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..4ab5fd191b74bcce59ea700f6bcc7b1bab65f13e
--- /dev/null
+++ b/src/main/java/de/tr7zw/yapfa/events/GameProfileLookupEvent.java
@@ -0,0 +1,45 @@
+package de.tr7zw.yapfa.events;
+
+import java.util.UUID;
+
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+
+import com.mojang.authlib.GameProfile;
+
+public class GameProfileLookupEvent extends Event {
+ private static final HandlerList handlers = new HandlerList();
+ private GameProfile gameProfile = null;
+ private final UUID uuid;
+ private final String name;
+
+ public GameProfileLookupEvent(boolean async, UUID uuid, String name) {
+ super(async);
+ this.uuid = uuid;
+ this.name = name;
+ }
+
+ public GameProfile getGameProfile() {
+ return gameProfile;
+ }
+
+ public void setGameProfile(GameProfile gameProfile) {
+ this.gameProfile = gameProfile;
+ }
+
+ public UUID getUuid() {
+ return uuid;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}