Move ProfileWhitelistVerifyEvent to use new PlayerProfile API

Also update javadocs on lookup events to link the new methods to use
This commit is contained in:
Aikar 2018-01-19 00:12:03 -05:00
parent 18e3bf685c
commit 531981a1cc
No known key found for this signature in database
GPG key ID: 401ADFC9891FAAFE
4 changed files with 51 additions and 16 deletions

View file

@ -1,4 +1,4 @@
From 75a76f4448b91caeb0c7ab06a8cdf5f26deb8818 Mon Sep 17 00:00:00 2001
From 69a0afed643918933b0ad8f6d81780dafa33cf6b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 3 Jul 2017 18:11:34 -0500
Subject: [PATCH] ProfileWhitelistVerifyEvent
@ -9,10 +9,10 @@ Allows you to do dynamic whitelisting and change of kick message
diff --git a/src/main/java/com/destroystokyo/paper/event/profile/ProfileWhitelistVerifyEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/ProfileWhitelistVerifyEvent.java
new file mode 100644
index 00000000..59b69b23
index 00000000..662e79e3
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/profile/ProfileWhitelistVerifyEvent.java
@@ -0,0 +1,110 @@
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2017 - Daniel Ennis (Aikar) - MIT License
+ *
@ -38,6 +38,7 @@ index 00000000..59b69b23
+
+package com.destroystokyo.paper.event.profile;
+
+import com.destroystokyo.paper.profile.PlayerProfile;
+import com.mojang.authlib.GameProfile;
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
@ -51,13 +52,13 @@ index 00000000..59b69b23
+ */
+public class ProfileWhitelistVerifyEvent extends Event {
+ private static final HandlerList handlers = new HandlerList();
+ private final GameProfile profile;
+ private final PlayerProfile profile;
+ private final boolean whitelistEnabled;
+ private boolean whitelisted;
+ private final boolean isOp;
+ private String kickMessage;
+
+ public ProfileWhitelistVerifyEvent(final GameProfile profile, boolean whitelistEnabled, boolean whitelisted, boolean isOp, String kickMessage) {
+ public ProfileWhitelistVerifyEvent(final PlayerProfile profile, boolean whitelistEnabled, boolean whitelisted, boolean isOp, String kickMessage) {
+ this.profile = profile;
+ this.whitelistEnabled = whitelistEnabled;
+ this.whitelisted = whitelisted;
@ -81,8 +82,17 @@ index 00000000..59b69b23
+
+ /**
+ * The gameprofile of the player trying to connect
+ * @deprecated Will be removed in 1.13, use #{@link #getPlayerProfile()}
+ */
+ @Deprecated
+ public GameProfile getProfile() {
+ return profile.getGameProfile();
+ }
+
+ /**
+ * @return The profile of the player trying to connect
+ */
+ public PlayerProfile getPlayerProfile() {
+ return profile;
+ }
+