From 71d1bb3e2d45cd3bd706b1f2a6d70f2530ed88a0 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Tue, 11 Oct 2011 14:51:28 +0100 Subject: [PATCH] Added OfflinePlayer.getPlayer() for getting the online Player object By: Nathan Adams --- paper-api/src/main/java/org/bukkit/OfflinePlayer.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/OfflinePlayer.java b/paper-api/src/main/java/org/bukkit/OfflinePlayer.java index f0d59c3ab1..76f499fc08 100644 --- a/paper-api/src/main/java/org/bukkit/OfflinePlayer.java +++ b/paper-api/src/main/java/org/bukkit/OfflinePlayer.java @@ -2,6 +2,7 @@ package org.bukkit; import org.bukkit.configuration.serialization.ConfigurationSerializable; import org.bukkit.entity.AnimalTamer; +import org.bukkit.entity.Player; import org.bukkit.permissions.ServerOperator; public interface OfflinePlayer extends ServerOperator, AnimalTamer, ConfigurationSerializable { @@ -46,4 +47,14 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * @param value true if whitelisted */ public void setWhitelisted(boolean value); + + /** + * Gets a {@link Player} object that this represents, if there is one + *

+ * If the player is online, this will return that player. Otherwise, + * it will return null. + * + * @return Online player + */ + public Player getPlayer(); }