Yatopia/patches/api/0031-Add-GameProfileLookupEvent.patch

95 lines
2.5 KiB
Diff
Raw Normal View History

2020-03-08 16:18:34 +01:00
From 1bd45bffe8d3ae9c4b67794f60b2ac31e360002c Mon Sep 17 00:00:00 2001
2020-02-26 22:22:46 +01:00
From: tr7zw <tr7zw@live.de>
Date: Wed, 26 Feb 2020 22:21:14 +0100
Subject: [PATCH] Add GameProfileLookupEvent
---
2020-02-27 22:17:46 +01:00
pom.xml | 11 +++++
.../yapfa/events/GameProfileLookupEvent.java | 45 +++++++++++++++++++
2 files changed, 56 insertions(+)
2020-02-26 22:22:46 +01:00
create mode 100644 src/main/java/de/tr7zw/yapfa/events/GameProfileLookupEvent.java
diff --git a/pom.xml b/pom.xml
index ca897873..3f97b2be 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
2020-03-08 16:18:34 +01:00
index 00000000..82ffe5a5
2020-02-26 22:22:46 +01:00
--- /dev/null
+++ b/src/main/java/de/tr7zw/yapfa/events/GameProfileLookupEvent.java
2020-02-27 22:17:46 +01:00
@@ -0,0 +1,45 @@
2020-02-26 22:22:46 +01:00
+package de.tr7zw.yapfa.events;
+
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;
+
+import com.mojang.authlib.GameProfile;
+
+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
+
2020-02-27 22:17:46 +01:00
+ public GameProfileLookupEvent(UUID uuid, String name) {
2020-03-08 16:18:34 +01:00
+ super(true);
2020-02-27 22:17:46 +01:00
+ this.uuid = uuid;
+ this.name = name;
+ }
2020-02-26 22:22:46 +01:00
+
+ public GameProfile getGameProfile() {
+ return gameProfile;
+ }
+
+ public void setGameProfile(GameProfile gameProfile) {
+ this.gameProfile = gameProfile;
+ }
+
2020-02-27 22:17:46 +01:00
+ public UUID getUuid() {
+ return uuid;
+ }
+
+ public String getName() {
+ return name;
+ }
+
2020-02-26 22:22:46 +01:00
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
--
2.25.1.windows.1