From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: tr7zw Date: Sat, 1 Aug 2020 15:52:50 -0500 Subject: [PATCH] Add GameProfileLookupEvent Original code by YatopiaMC, licensed under MIT You can find the original code on https://github.com/YatopiaMC/Yatopia diff --git a/build.gradle.kts b/build.gradle.kts index f00d21bdb0fced241dbbd37784c05f1c3a4598e4..129c5b41b410b57952fedf90c1ea713ba1c36470 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -50,6 +50,7 @@ dependencies { compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.2") compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.2") compileOnly("com.google.code.findbugs:jsr305:1.3.9") // Paper + compileOnly("com.mojang:authlib:3.2.38") // Yatopia val annotations = "org.jetbrains:annotations:23.0.0" // Paper - we don't want Java 5 annotations... compileOnly(annotations) diff --git a/src/main/java/org/yatopiamc/yatopia/api/events/GameProfileLookupEvent.java b/src/main/java/org/yatopiamc/yatopia/api/events/GameProfileLookupEvent.java new file mode 100644 index 0000000000000000000000000000000000000000..d7db9c87dc82c883004a906e024d2f6de3e40961 --- /dev/null +++ b/src/main/java/org/yatopiamc/yatopia/api/events/GameProfileLookupEvent.java @@ -0,0 +1,51 @@ +package org.yatopiamc.yatopia.api.events; + +import com.mojang.authlib.GameProfile; +import java.util.UUID; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +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, @NotNull UUID uuid, @NotNull String name) { + super(async); + this.uuid = uuid; + this.name = name; + } + + @Nullable + public GameProfile getGameProfile() { + return gameProfile; + } + + public void setGameProfile(@Nullable GameProfile gameProfile) { + this.gameProfile = gameProfile; + } + + @NotNull + public UUID getUuid() { + return uuid; + } + + @NotNull + public String getName() { + return name; + } + + @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + + @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} \ No newline at end of file