From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Etil <81570777+etil2jz@users.noreply.github.com> Date: Thu, 9 Dec 2021 19:00:39 +0100 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 f44d9fef297c8f6d4cf42b40f738d704d5207f5f..6e05b88a8ef08c2d267920888f20edffe120a7fa 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.0") compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.0") compileOnly("com.google.code.findbugs:jsr305:1.3.9") // Paper + compileOnly("com.mojang:authlib:3.2.38") // Yatopia val annotations = "org.jetbrains:annotations:21.0.1" // 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